/**
 * @author ZCR
 * @create 2025/9/8 21:00
 */
public class LCR127 {
    public int trainWays(int num) {
        if(num==0) return 1;
        if (num <= 2) {
            return num;
        }
        int mod = 1000000007;
        int first = 1, second = 2;
        for (int i = 3; i <= num; i++) {
            int temp = (first + second) % mod;
            first = second;
            second = temp;
        }
        return second;
    }
}
